---
id: limit
title: "limit()"
slug: limit
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Limits the result with the specified `count`.

<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .limit(1)
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>

## Parameters


<ul className="method-list-group">
  
<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      count
    </span>
    <span className="method-list-item-label-badge required">
      required
    </span>
    <span className="method-list-item-validation">
      number
    </span>
  </h4>
  <div class="method-list-item-description">

The maximum no. of rows to limit to.
  
  </div>
  
</li>


<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      __namedParameters
    </span>
    <span className="method-list-item-label-badge required">
      required
    </span>
    <span className="method-list-item-validation">
      object
    </span>
  </h4>
  <div class="method-list-item-description">

No description provided. 
  
  </div>
  
<ul className="method-list-group">
  <h5 class="method-list-title method-list-title-isChild expanded">Properties</h5>

<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      foreignTable
    </span>
    <span className="method-list-item-label-badge required">
      required
    </span>
    <span className="method-list-item-validation">
       | 
    </span>
  </h4>
  <div class="method-list-item-description">

The foreign table to use (for foreign columns).
  
  </div>
  
</li>

</ul>

</li>

</ul>














## Examples

### With `select()`



<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .limit(1)
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>

### With embedded resources



<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { data, error } = await supabase
  .from('cities')
  .select('name, cities(name)')
  .eq('name', 'United States')
  .limit(1, 'cities')
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>